package demo.api.enterprise;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import util.HttpClientUtil;

public class MessageVerify {
	
	private static String appKey = "cAwut4VATycNMq17NZeFUD63pe83l2OJ";
    private static String appSecrty = "3BAlrfr7lW8kwlCMfo1dXS8Syn5q5qjS";
    private static String baseUrl = "http://smp-test.szitrus.com.cn/smp-api";
    private static String api = "/api/enterprise/message/verify";

	public static void main(String[] args) throws IOException {
		String url = baseUrl.concat(api); 
	    // 请求参数
	    Map<String, String> params = new HashMap<>();
	    params.put("plaintext", "表单原文-测试表单签名");//原文
	    params.put("signature_value", "MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIIEfTCCA2WgAwIBAgIURV0fPzKBOPGlX2fOFERKeTWDT8IwDQYJKoZIhvcNAQELBQAwgY0xRzBFBgNVBAMMPlNoZW4gWmhlbiBpVHJ1c0NoaW5hIENsYXNzIEVudGVycHJpc2UgU3Vic2NyaWJlciBDQSBSU0EgLSBUZXN0MRgwFgYDVQQLDA/mtYvor5Xpg6jor5XnlKgxGzAZBgNVBAoMEuWkqeivmuWuieS/oeivleeUqDELMAkGA1UEBhMCQ04wHhcNMjAwNTA2MDkwODMyWhcNMjMwNTA2MDkwODMyWjCBmDELMAkGA1UEBgwCQ04xODA2BgNVBAoML+a3seWcs+W4guWkqeWogeivmuS/oeenkeaKgOaciemZkOWFrOWPuCjmtYvor5UpMR0wGwYDVQQLDBRSU0Eg6K+B5Lmm77yI5rWL6K+VKTEwMC4GA1UEAwwn5rex5Zyz5biC5aSp5aiB6K+a5L+h56eR5oqA5pyJ6ZmQ5YWs5Y+4MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwhtjDViSLht1QbtWlpoonUoPT8ouQ6BtecgxkEIXgQsZuPSKxaaHnFtrne+ZZn05llTJ9JCzwXcKivw009ca9QWB/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GzAZBgNVBAoMEuWkqeivmuWuieS/oeivleeUqDELMAkGA1UEBhMCQ04CFEVdHz8ygTjxpV9nzhRESnk1g0/CMA0GCWCGSAFlAwQCAQUAMA0GCSqGSIb3DQEBCwUABIIBAAVlM0r6biEgZV9iFJA5t/zflPRSzOpyj+6NqOIL46hY1CaVyQ9BpqWL/gVE/o70qkewIULweYXAqa28pR10vE5gfLZLlu94AjzlWY2lgEDeIgphol4Q36SJPpDGYze8ma+Y0WF2H0adc4bHRfKOPL1v6f+w8u1hRADhoVQ6rndK3xLdyKHuRVr2nhPdPqwUmK16PxVhU2sU4k2NJiiKW2M8N1TYqZZLIjcl6Wt2sL5Mb47at5vHTA9+12AZF47bfcpXkQ/y0dHeksSkZL7hGhj3MH7ibPWgpsbv90XvygZft8odDc+zr8OJQI70Qikybu1BWuZqqYZEkdQVwqzDoGMAAAAAAAA=");
	    String resStr =  HttpClientUtil.getResponse(url, params, appKey, appSecrty);
	    JSONObject resJson = JSON.parseObject(resStr);
	    System.out.println(resJson);
	} 
}
